#################################################################
### DATAVERSE FOR							                  ###	
### Mark Andreas Kayser and René Lindstädt                    ###
### "A Cross-National Measure of Electoral Competitiveness"   ###
#################################################################

################
### Overview ###
################

The Dataverse has 5 folders.

1. _data_setup: 
Code to generate seats-votes estimates for SMD systems and to generate the main data sets used in the article.

2. _data: 
Holds the district-level election data used to generate the seats-votes estimates, R images with the seats-votes estimates, a spreadsheet file (csv) with electoral data to calculate historical vote and seat swings, and R images of the main data sets used in the analyses.

3. _third_party_data:
Holds data on price levels (Prices subfolder) and electoral systems (Golder subfolder).

4. _manuscript_tabfig:
Holds files to generate the tables and figures included in the main manuscript.

5. _supportingmaterials_tabfig:
Holds files to generate tables and figures included in the supporting materials.


###################
### _data_setup ###
###################

1. sv_smd.R:
To generate seats-votes estimates.

2. lpr_data.R:
To generate main data set.

3. lpr_data_plus.R:
To add third-party data to main data set.


#############
### _data ###
#############

1. electoral folder:
Holds the district-level election data used to generate the seats-votes estimates.

2. sv_estimates folder:
Holds R images with the seats-votes estimates for the SMD systems.

3. LossProbMaster_post1945_130707-MK.csv:
Holds electoral data to calculate historical vote and seat swings.

4. lprdata.RData:
R image with main data set.

5. lprdata_plus.RData:
R image with main data and third-party data.

6. TheLossProbVariable.csv:
Main data set for easy use by other researchers.


#########################
### _third_party_data ###
#########################

1. Prices folder:
Holds source data (pricesdata_july2013-Mat.dta) and documentation for the source data (price-notes-July_Mat.rtf).

2. Golder folder:
Holds Stata do file to generate modified Golder data (golder_prep.do) and the modified Golder data (avemag.dta).


##########################
### _manuscript_tabfig ###
##########################

1. ElectoralRisk_Figures.R:
Code to generate Figures 1 and 3 in main manuscript and Figures 5, 7 and 8 in Supporting Materials.

2. prices_analysis.R:
Code generate Table 2 and Figure 2 in main manuscript.


###################################
### _supportingmaterials_tabfig ###
###################################

1. can_swing_time.R:
Code to generate Figure 1 in Supporting Materials.

2. pr_code_limitcase_aus06.R:
Code to generate Figure 2 in Supporting Materials.

3. pr_code_limitcase_esp96.R:
Code to generate Figure 3 in Supporting Materials.

4. lpr_density_variation.R:
Code to generate Figure 4 in Supporting Materials.

5. lpr_bootstrap.R:
Code to generate Figure 6 in Supporting Materials.